package xin.nick.demo;

import lombok.Generated;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;


@Log4j2
@RestController
public class DemoController {

    @GetMapping("/logDemo1")
    public String login() {
        String requestId = UUID.randomUUID().toString();
        log.info("requestId: {}: 用户登录成功", requestId);
        getUserInfo(requestId);
        return new StringBuilder("登录OK,requestId:").append(requestId).toString();
    }

    public void getUserInfo(String requestId) {
        log.info("requestId: {}: 用户开始获取信息", requestId);
        getCoupns(requestId);
    }
    public void getCoupns(String requestId) {
        log.info("requestId: {}: 用户获取优惠券信息", requestId);
    }


}
